package com.io;

import org.apache.commons.io.IOUtils;

import java.io.*;
import java.util.Properties;

public class ReadProperties {
    public static void main(String[] args) {
        InputStream is = null;
        Properties properties = new Properties();

        try {
            is = ReadProperties.class.getClassLoader().getResourceAsStream("info.properties");

            properties.load(is);
            System.out.println(properties.getProperty("name"));
            System.out.println(properties.getProperty("age"));


        } catch (IOException e) {
            e.printStackTrace();
        } finally {

            IOUtils.closeQuietly(is);
        }

    }
}
